package com.xieke.admin.web;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xieke.admin.dto.ResultInfo;
import com.xieke.admin.entity.HisTjDjb;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.*;
import javax.annotation.Resource;
import org.springframework.stereotype.Controller;

import com.xieke.admin.service.IHisTjDjbService;

/**
 *  前端控制器
 *
 * @author xieke
 * @email 949118693@qq.com
 * @date 2019-07-26 10:45:37
 */
@Controller
@RequestMapping("/hisTjDjb")
public class HisTjDjbController {
    @Resource
    private IHisTjDjbService iHisTjDjbService;

    @RequestMapping("/*")
    public void toHtml(){

    }

//    @RequestMapping("/listData")
//    @RequiresPermissions("hisTjDjb:view")
//    public @ResponseBody
//    ResultInfo<List<HisTjDjb>> listData(HisTjDjb hisTjDjb, Integer page, Integer limit){
//        QueryWrapper<HisTjDjb> wrapper = new QueryWrapper<>(hisTjDjb);
//        wrapper.setEntity(hisTjDjb);
//        IPage<HisTjDjb> pageObj = iHisTjDjbService.getBaseMapper().selectPage(new Page<>(page,limit), wrapper);
//        return new ResultInfo<>(pageObj.getRecords(), (int)pageObj.getTotal());
//    }
//
//    @RequestMapping("/add")
//    @RequiresPermissions("hisTjDjb:add")
//    public @ResponseBody
//    ResultInfo<Boolean> add(HisTjDjb hisTjDjb){
//        boolean b = iHisTjDjbService.save(hisTjDjb);
//        return new ResultInfo<>(b);
//    }
//
//    @RequestMapping("/delBatch")
//    @RequiresPermissions("hisTjDjb:del")
//    public @ResponseBody
//    ResultInfo<Boolean> delBatch(Integer[] idArr){
//        boolean b = iHisTjDjbService.getBaseMapper().deleteBatchIds(Arrays.asList(idArr))>0?true:false;
//        return new ResultInfo<>(b);
//    }
//
//    @RequestMapping("/edit")
//    @RequiresPermissions("hisTjDjb:edit")
//    public @ResponseBody
//    ResultInfo<Boolean> edit(HisTjDjb hisTjDjb){
//        boolean b = iHisTjDjbService.updateById(hisTjDjb);
//        return new ResultInfo<>(b);
//    }

}
